(STAK ( c KH@: 33f b """"""""̪3̪3 @"""""D"DĀ hC0&0 "U""U"U"UU"Uwwww݀UUUUH0 D9D"AA"A>"t"%2d$LA*@ @ "t"G"q]APPi   On OpenStack Get EnterMovies() If it is not empty then Answer "Error" && it && "initializing Movie Toolbox" End If End OpenStack On CloseStack ExitMovies End CloseStack -- -- Brief notes on the externals attached to this stack: -- -- XFCN CreateMovie(MovieFile, FrameBounds, PixelDepth, -- CompressorID, SpatialQuality, TemporalQuality, -- KeyFrameRate, DefaultFrameDuration, DitherDown) -- creates a new video-only movie which will be saved in -- the specified movie file, and returns a context that can -- be passed to AddMovieFrame to add frames to the movie. -- FrameBounds is a rectangle defining the bounds of the -- movie image (AddMovieFrame will clip pictures to this -- boundary), and DitherDown is true if the images are -- to be dithered to the specified pixel depth before -- being added to the movie (default is false). -- -- XCMD AddMovieFrame Context, FramePicture, FrameDuration -- adds a new movie to a movie context created by CreateMovie. -- FramePicture is a handle to the picture forming the image, -- and FrameDuration is the duration of the frame (defaults -- to the DefaultFrameDuration passed to CreateMovie). -- -- XCMD FinishedMovie Context, Abandon -- finishes creation of a movie, saves the movie in file, -- and frees up memory. If Abandon is true, the movie is -- not saved (default is false). -- -- XFCN GetPICSInfo(InfoHandle) -- decodes an "INFO" resource handle from a PICS file, -- returning a six-line string containing the following: -- * BWColor (0 for B/W 1 for colour/greyscale) -- * PixelDepth -- * Speed (positive for frames per second, negative for seconds per frame) -- * Version (should be 0) -- * Creator code -- * LargestPictureSize (0 if unknown) -- -- XFCN MakePICSInfo(SrcInfo) -- encodes a six-line string of the form returned by -- GetPICSInfo, and puts the result into a new handle -- which can be added to a PICS file as its INFO resource. -- -- The above externals were specifically written for use -- in this stack, but the ones below are of more general use. -- -- XFCN EnterMovies() -- initializes the QuickTime Movie Toolbox. Must be called -- at least once before using any Movie Toolbox routines. -- -- XCMD ExitMovies -- terminates use of the Movie Toolbox. Must be called once -- for each call to EnterMovies. -- -- XCMD CreateMovieFile MovieFileName, DeleteExisting, CreatorCode -- creates a new movie file. DeleteExisting is true to -- delete an existing file of the same name. CreatorCode -- is the optional four-character signature to give to the -- movie file; the default is TVOD, which is the creator code -- for Apples Simple Player. -- -- XFCN OpenResFile(ResFileName, ReadWrite) -- opens a resource file and returns the integer refnum. -- ReadWrite is true for read/write access, false for -- read-only (default is false). Returns an empty result -- if you try to open a resource file thats already open. -- On return, the current resource file is still what -- it was before, so resources from this file dont -- inadvertently get used elsewhere. -- -- XFCN GetResource(ResFile, ResType, ResID, UseSysHeap) -- reads a resource from the specified resource file, -- with the specified type and ID, makes it nonpurgeable, -- and returns its handle. UseSysHeap is true to load -- the resource into the system heap, which is useful if it -- might be potentially large (default is false, ignored in -- any case if MultiFinder is not running). -- -- XCMD CloseResFile ResFile -- closes a resource file previously opened by OpenResFile. -- -- XCMD ReleaseResource TheResource -- frees up the memory occupied by a resource. -- -- XFCN PopUpMenuSelect(MainMenu, Top, Left, PopUpItem, -- subMenu1, subMenu2 ... ) -- displays a pop-up text menu (with optional submenus) and -- returns the users selection. Each menu is expressed as -- a string containing one item to a line, and you can use -- any of the special characters recognized by the AppendMenu -- routine in the Menu Manager, with the exception of keyboard -- shortcuts, which are used to indicate links to submenus. -- Top and Left are the position (in global coordinates) -- at which to display the menu, and PopUpItem is the number -- of the main menu item which is to appear at that position. -- The function result is zero to indicate no selection was -- made, or a single integer indicating a selection from the -- main menu, or a pair of integers to indicate a selection -- from a submenu. -- -- XFCN ListCodecs(ShowAll) -- returns a list of all the QuickTime codecs (image compressors/ -- decompressors) currently installed. The first four characters of -- each line uniquely identify the compression algorithm, the rest -- is the descriptive name. ShowAll is true to list all codec -- components and their names, false to list only one for each -- compression algorithm and the name of the algorithm rather than -- that of the codec. -- -- XFCN GetCodecFlags(CodecType, CodecComponent) -- returns information flags about a codec. CodecType is -- the four-character code identifying the compression -- algorithm, and CodecComponent is one of the special -- values identifying e g the one that gives the best quality, -- the best compression, or works the fastest (default is -- anyCodec). -- The function result consists of three 32-bit binary -- integers, one to a line; the first corresponds to the -- compressFlags field returned by the GetCodecInfo Image Compression -- Manager routine, the second is the decompressFlags, and the -- third is the formatFlags. -- -- XFCN PictureFrame(ThePicture) -- returns the bounding rectangle for a QuickDraw picture. -- -- XFCN NewMovieFromFile(MovieFileName, Flags) -- loads a movie into memory from a movie resource attached -- to a movie file. MovieFileName is the name of the movie -- file, and Flags is the integer representation of the -- newMovieFlags argument passed to the NewMovieFromFile -- Movie Toolbox routine. -- -- XFCN PutFile(Prompt, DefaultFileName) -- brings up the standard putfile dialog. The only reason -- for using this instead of the ask file command in -- HyperCard 2.0/2.1 is because, under System 7, the latter -- doesnt use the new standard dialog with the New Folder -- button. -- -- XCMD CreateResFile ResFileName, FileType, -- FileCreator, DeleteExisting -- creates a new resource file with the given name, -- file type and file creator code. DeleteExisting is -- true to delete any existing file with the same name, -- false to return an error if the file already exists. -- -- XCMD AddResource TheResFile, TheResource, TheResType, -- TheResID, ResName, ResAttributes -- adds a new resource to a file opened with OpenResFile, -- with the specified type, ID, name and attributes. -- -- XCMD UpdateResFile TheResFile -- flushes to disk all changes previously made to a resource file. -- -- XFCN GetHandleSize(TheHandle) -- returns the size in bytes of a relocatable memory block, -- given a handle to it. -- -- XCMD DisposeMovie TheMovie -- frees the memory occupied by a QuickTime movie. -- -- XFCN GetMovieTimeScale(TheMovie) -- returns the time scale (maximum number of events per -- second that can be distinguished) of a QuickTime movie. -- -- XFCN GetMoviePict(TheMovie, TheTime) -- returns a QuickDraw picture representing the image -- that would be displayed by the movie at the specified -- time (in units of its time scale). -- -- XFCN GetMovieNextInterestingTime(TheMovie, InterestingTimeFlags, -- MediaTypes, FromTime, Forwards) -- lets you search a movie for events of particular types. MediaTypes -- specifies the types of the media to search, as the concatenation -- of the four-character media types (e g "vide" for video, "soun" -- for sound tracks), FromTime is the time from which to search, -- and Forwards is true to search forwards, false to look backwards. -- The function result contains two numbers, one to a line: the first -- is the time of the event found, and the second is its duration; -- if no matching event could be found, the function result is the -- empty string. -- -- XCMD DisposePicture ThePicture -- frees the memory occupied by a QuickDraw picture. -- -- XCMD PictureToFile ThePicture, TheFileName, Signature -- writes a QuickDraw picture to disk as a PICT file. ThePicture -- is the handle to the picture to be written, TheFileName is -- the name of the file to create, and Signature is the four-character -- creator code to give to the file. -- -- XFCN PictureFromFile(TheFileName) -- reads the contents of a PICT file into memory -- and returns a handle to the newly-created QuickDraw picture. --MASTPHTvc. -- where is a sequence of decimal digits, and -- returns the position of the dot separator. Returns -- zero if InName is not of this form. Put the length of InName into ThisPos Repeat If ThisPos = 0 then Exit Repeat End If Get char ThisPos of InName If it = "." then Exit Repeat End If If it < "0" or it > "9" then Put 0 into ThisPos Exit Repeat End If Subtract 1 from ThisPos End Repeat Return ThisPos End FindNumberSuffix Function FileNamePart Pathname -- returns Pathname with prefixing volume and folder names stripped off. Repeat Get Offset(":", Pathname) If it = 0 or it = the length of Pathname then Exit Repeat End If Delete char 1 to it of Pathname End Repeat Return Pathname End FileNamePart On AllDone Play "Harpsichord" tempo 200 "d ge f# g" End AllDone -- -- perform the conversion functions -- On ConvertPICStoMovie Put empty into Cleanup Go to card id 3783 -- remind user about compression settings Answer file "Select PICS file to convert:" of type "PICS" If it is empty then Do Cleanup Exit ConvertPICStoMovie End If Put it into PICSfileName Ask file "Movie file to create?" If it is empty then Do Cleanup Exit ConvertPICStoMovie End If Put it into MovieFileName Get OpenResFile(PICSfileName) If it < 0 then Answer "Error" && it && "opening PICS file." Do Cleanup Exit ConvertPICStoMovie Else if it = 0 then Answer "Hmm, that file is already open." with "Uh-oh" Do Cleanup Exit ConvertPICStoMovie End If Put it into PICSfile Put "CloseResFile" && it & return after Cleanup CreateMovieFile MovieFileName, true Get the result If it is not empty then Answer "Error" && it && "creating movie file." Do Cleanup Exit ConvertPICStoMovie End If Get GetResource(PICSfile, "INFO", 128) If it > 0 then Put line 3 of GetPICSInfo(it) into FrameRate ReleaseResource it If FrameRate < 0 then Put - 1.0 / FrameRate into FrameRate End If Else Put 1.0 into FrameRate End If Ask "Whats the speed of the movie (in frames per second)?" with FrameRate If it is empty then Do Cleanup Exit ConvertPICStoMovie End If Put the value of it into FrameRate -- allows expressions like 1/5 Put 128 into PICTResID Get GetResource(PICSfile, "PICT", PICTResID) If it 0 then Answer "First picture frame missing from PICS file." Do Cleanup Exit ConvertPICStoMovie End If Put it into ThisPicture Put PictureFrame(ThisPicture) into FrameBounds Get CreateMovie( MovieFileName, FrameBounds, line (card field "Compression Depth Code") of PixelDepths(), card field "Compressor ID", card field "Spatial Quality", card field "Temporal Quality", card field "Key Frame Rate", 1.0 / FrameRate) If it < 0 then Answer "Error" && it && "creating movie." Do Cleanup Exit ConvertPICStoMovie End If Put it into TheMovie Put "FinishedMovie" && it & return after Cleanup Repeat Set cursor to busy AddMovieFrame TheMovie, ThisPicture Get the result If it is not empty then Answer "Error" && it && "adding frame to movie." Exit Repeat End If ReleaseResource ThisPicture Add 1 to PICTResID Get GetResource(PICSfile, "PICT", PICTResID) If it 0 then Exit Repeat End If Put it into ThisPicture End Repeat Do Cleanup AllDone End ConvertPICStoMovie On ConvertPICTfilesToMovie Put empty into Cleanup Go to card id 3783 -- remind user about compression settings Answer file "Select first PICT file to convert:" of type "PICT" If it is empty then Do Cleanup Exit ConvertPICTfilesToMovie End If Put it into FirstPictureFile Get FindNumberSuffix(FirstPictureFile) If it = 0 then Get FileNamePart(FirstPictureFile) Answer "Your PICT files must have names like " & it & ".001, " & it & ".002" & " and so on." Do Cleanup Exit ConvertPICTfilesToMovie End If Put the length of FirstPictureFile - it into SuffixLength Put char (it + 1) to (the length of FirstPictureFile) of FirstPictureFile into CurrSuffix Put char 1 to (it - 1) of FirstPictureFile into NamePrefix Answer file "And the PICT file which ends the sequence:" of type "PICT" If it is empty then Do Cleanup Exit ConvertPICTfilesToMovie End If Put it into LastPictureFile Get FindNumberSuffix(LastPictureFile) If it = 0 then Answer "Name doesnt agree with first PICT file." Do Cleanup Exit ConvertPICTfilesToMovie End If If char 1 to (it - 1) of LastPictureFile NamePrefix then Answer "Name doesnt agree with first PICT file." Do Cleanup Exit ConvertPICTfilesToMovie End If Put char (it + 1) to (the length of LastPictureFile) of LastPictureFile into LastSuffix If the length of LastSuffix the length of CurrSuffix then Answer "Number suffixes dont have the same number of digits." Do Cleanup Exit ConvertPICTfilesToMovie End If If LastSuffix < CurrSuffix then Answer "Starting number cant be after ending number." Do Cleanup Exit ConvertPICTfilesToMovie End If Get PictureFromFile(FirstPictureFile) If it < 0 then Answer "Error" && it && "loading first picture." Do Cleanup Exit ConvertPICTfilesToMovie End If Put it into ThisPicture Ask file "Movie file to create?" If it is empty then Do Cleanup Exit ConvertPICTfilesToMovie End If Put it into MovieFileName CreateMovieFile MovieFileName, true Get the result If it is not empty then Answer "Error" && it && "creating movie file." Do Cleanup Exit ConvertPICTfilesToMovie End If Ask "Whats the speed of the movie (in frames per second)?" with "1.0" Put the value of it into FrameRate Put PictureFrame(ThisPicture) into FrameBounds Get CreateMovie( MovieFileName, FrameBounds, line (card field "Compression Depth Code") of PixelDepths(), card field "Compressor ID", card field "Spatial Quality", card field "Temporal Quality", card field "Key Frame Rate", 1.0 / FrameRate) If it < 0 then Answer "Error" && it && "creating movie." Do Cleanup Exit ConvertPICTfilesToMovie End If Put it into TheMovie Put "FinishedMovie" && it & return after Cleanup Repeat Set cursor to busy AddMovieFrame TheMovie, ThisPicture Get the result If it is not empty then Answer "Error" && it && "adding frame to movie." DisposePicture ThisPicture Exit Repeat End If DisposePicture ThisPicture Repeat If CurrSuffix = LastSuffix then Get 0 Exit Repeat End If Set numberformat to char 1 to SuffixLength of "0000000000" Add 1 to CurrSuffix Get PictureFromFile(NamePrefix & "." & CurrSuffix) If it > 0 then Exit Repeat End If Answer "Missing frame number" && CurrSuffix & "." with "Skip" or "Stop" If it is "Stop" then Get 0 Exit Repeat End If End Repeat If it 0 then Exit Repeat End If Put it into ThisPicture End Repeat Do Cleanup AllDone End ConvertPICTfilesToMovie On ConvertMovieToPICS Put empty into Cleanup Answer file "Select movie file to convert:" of type "MooV" If it is empty then Do Cleanup Exit ConvertMovieToPICS End If Put it into MovieFileName Ask file "PICS file to create?" If it is empty then Do Cleanup Exit ConvertMovieToPICS End If Put it into PICSfileName Get NewMovieFromFile(MovieFileName) If it < 0 then Answer "Error" && it && "loading movie." Do Cleanup Exit ConvertMovieToPICS End If Put it into TheMovie Put "DisposeMovie" && it & return after Cleanup CreateResFile PICSfileName, "PICS", "????", true Get the result If it is not empty then Answer "Error" && it && "creating PICS file." Do Cleanup Exit ConvertMovieToPICS End If Get OpenResFile(PICSfileName, true) If it < 0 then Answer "Error" && it && "opening PICS file." Do Cleanup Exit ConvertMovieToPICS Else If it is empty then Answer "Hmm, that file is already open." with "Uh-oh" Do Cleanup Exit ConvertMovieToPICS End If Put it into PICSfile Put "CloseResFile" && it & return after Cleanup Put 32769 into SearchNextMediaSample Put 16384 into SearchEdgeOK Put SearchNextMediaSample + SearchEdgeOK into SearchFlags Put 0 into MovieTime Put 0 into LargestPictureSize Put 0 into FrameCount Put 32767 - 128 + 1 into MaxFrameCount Repeat Set cursor to busy Put MovieTime into LastMovieTime Get line 1 of GetMovieNextInterestingTime(TheMovie, SearchFlags, "vide", MovieTime, true) If it < 0 then Exit Repeat End If Put it into MovieTime If SearchFlags = SearchNextMediaSample and MovieTime = LastMovieTime then Answer "QuickTime bug! Stuck at movie time" && MovieTime & "!" Exit Repeat End If If FrameCount = MaxFrameCount then Answer "Too many frames in movie!" Exit Repeat End If Get GetMoviePict(TheMovie, MovieTime) If it < 0 then Answer "Error" && it && "getting movie picture." Exit Repeat End If Put it into ThisFrame Add 1 to FrameCount AddResource PICSfile, ThisFrame, "PICT", 127 + FrameCount, "", 32 UpdateResFile PICSfile Get GetHandleSize(ThisFrame) If it > LargestPictureSize then Put it into LargestPictureSize End If ReleaseResource ThisFrame Put SearchNextMediaSample into SearchFlags End Repeat Put GetMovieTimeScale(TheMovie) into MovieTimeScale Put FrameCount * MovieTimeScale / MovieTime into FrameRate If FrameRate < 1.0 then Put Round(1.0 / FrameRate) into PICSFrameRate IF PICSFrameRate = 0 then Put 1 into PICSFrameRate End If Put -PICSFrameRate into PICSFrameRate Else Put Round(FrameRate) into PICSFrameRate End If Put empty into PICSinfo Put 1 into line 1 of PICSinfo Put 16 into line 2 of PICSinfo -- should determine actual depth? Put PICSFrameRate into line 3 of PICSinfo Put 0 into line 4 of PICSinfo Put "????" into line 5 of PICSinfo Put LargestPictureSize into line 6 of PICSinfo Put MakePICSInfo(PICSinfo) into PICSinfo AddResource PICSfile, PICSinfo, "INFO", 128, "", 32 UpdateResFile PICSfile Do Cleanup AllDone End ConvertMovieToPICS On ConvertMovietoPICTfiles Put empty into Cleanup Answer file "Select movie file to convert:" of type "MooV" If it is empty then Do Cleanup Exit ConvertMovietoPICTfiles End If Put it into MovieFileName Get PutFile("First PICT file to create?") If it is empty then Do Cleanup Exit ConvertMovietoPICTfiles End If Put it into FirstPictureFile Get FindNumberSuffix(FirstPictureFile) If it 0 then Put the length of FirstPictureFile - it into SuffixLength Put char (it + 1) to (the length of FirstPictureFile) of FirstPictureFile into CurrSuffix Put char 1 to (it - 1) of FirstPictureFile into NamePrefix Else Put FirstPictureFile into NamePrefix Put "001" into CurrSuffix Put the length of CurrSuffix into SuffixLength End If Get NewMovieFromFile(MovieFileName) If it < 0 then Answer "Error" && it && "loading movie." Do Cleanup Exit ConvertMovietoPICTfiles End If Put it into TheMovie Put "DisposeMovie" && it & return after Cleanup Put 32769 into SearchNextMediaSample Put 16384 into SearchEdgeOK Put SearchNextMediaSample + SearchEdgeOK into SearchFlags Put 0 into MovieTime Repeat Set cursor to busy Put MovieTime into LastMovieTime Get line 1 of GetMovieNextInterestingTime(TheMovie, SearchFlags, "vide", MovieTime, true) If it < 0 then Exit Repeat End If Put it into MovieTime If SearchFlags = SearchNextMediaSample and MovieTime = LastMovieTime then Answer "QuickTime bug! Stuck at movie time" && MovieTime & "!" Exit Repeat End If Get GetMoviePict(TheMovie, MovieTime) If it < 0 then Answer "Error" && it && "getting movie picture." Exit Repeat End If Put it into ThisFrame PictureToFile ThisFrame, NamePrefix & "." & CurrSuffix, "ttxt" Get the result If it is not empty then Answer "Error" && it && "saving movie frame." Exit Repeat End If DisposePicture ThisFrame Set numberformat to char 1 to SuffixLength of "0000000000" Add 1 to CurrSuffix Put SearchNextMediaSample into SearchFlags End Repeat Do Cleanup AllDone End ConvertMovietoPICTfiles -- -- management of Conversion menu -- On CreateConversionMenu Create menu "Conversion" Put "PICS file to Movie..." after menu "Conversion" with MenuMsg "ConvertPICStoMovie" Put "Movie to PICS file..." after menu "Conversion" with MenuMsg "ConvertMovieToPICS" Put "-" after menu "Conversion" Put "PICT file sequence to Movie..." after menu "Conversion" with MenuMsg "ConvertPICTfilesToMovie" Put "Movie to PICT file sequence..." after menu "Conversion" with MenuMsg "ConvertMovietoPICTfiles" Put "-" after menu "Conversion" Put "Compression settings..." after menu "Conversion" with MenuMsg "Go to card ID 3783" End CreateConversionMenu On DeleteConversionMenu If there is a menu "Conversion" then Delete menu "Conversion" End If End DeleteConversionMenu -- -- top-level handlers -- On OpenBackground CreateConversionMenu End OpenBackground On CloseBackground DeleteConversionMenu End CloseBackground On SuspendStack DeleteConversionMenu Pass SuspendStack End SuspendStack On ResumeStack CreateConversionMenu Pass ResumeStack End ResumeStack CARD K v c&$&  AboutThis stack provides some useful conversion functions between QuickTime movies and PICS and PICT files. Use the Conversion menu to access these functions. Written by Lawrence DOliveiro, Computer Services Dept, University of Waikato, Hamilton, New Zealand. Internet: ldo@waikato.ac.nz FREEFree Object v c Vpw Spatial QualityOn MouseDown DragSlider End MouseDownVw Temporal QualityOn MouseDown DragSlider End MouseDown6p Spatial Quality Left6p Spatial Quality Right6 Temporal Quality Left8 Temporal Quality Right0 iyx Spatial Quality2 {w Temporal Quality< F Spatial Quality Description> F Temporal Quality Description" ]>p "? ""4b .w Compressor ID"c5 Compressor NameOn MouseDown Put ListCodecs(false) into CompressorList Put empty into CompressorNames Put 0 into ChosenCompressor Repeat with ThisLine = 1 to the number of lines in CompressorList Get line ThisLine of CompressorList If (char 1 to 4 of it) = card field "Compressor ID" then Put ThisLine into ChosenCompressor End If Delete char 1 to 4 of it Put it into line ThisLine of CompressorNames End Repeat Put the top of the target + the top of card window into MenuTop Put the left of the target + the left of card window into MenuLeft If the mouse is up then TooQuick Exit MouseDown End If Get PopUpMenuSelect(CompressorNames, MenuTop, MenuLeft, ChosenCompressor) If it 0 then Put char 1 to 4 of line it of CompressorList into card field "Compressor ID" Put line it of CompressorNames into card field "Compressor Name" Put PixelDepthBits() into PixelDepthBits Put GetFormatFlags() into FormatFlags If char (line (card field "Compression Depth Code") of PixelDepthBits) of FormatFlags = 0 then -- new compressor doesnt support currently-chosen pixel depth. -- Find a depth that it does support (assume there must be one!), -- first searching the colour depths, then the greyscale ones, -- deepest first in each group. Put the number of lines in PixelDepthBits - 4 into ThisLine Repeat If char (line ThisLine of PixelDepthBits) of FormatFlags = 1 then Exit Repeat End If Subtract 1 from ThisLine If ThisLine = 0 then Put the number of lines in PixelDepthBits into ThisLine End If End Repeat Put ThisLine into card field "Compression Depth Code" Put line ThisLine of PixelDepthNames() into card field "Compression Depth Name" End If If not DoesTemporalCompression() then SetSlider "Temporal Quality", 0 End If End If End MouseDown <?cR Compression Depth NameOn MouseDown Put GetFormatFlags() into FormatFlags Put PixelDepthNames() into PixelDepthNames Put PixelDepthBits() into PixelDepthBits Repeat with ThisLine = 1 to the number of lines in PixelDepthBits If char (line ThisLine of PixelDepthBits) of FormatFlags = 0 then Put "(" before line ThisLine of PixelDepthNames End If End Repeat Put the top of the target + the top of card window into MenuTop Put the left of the target + the left of card window into MenuLeft If the mouse is up then TooQuick Exit MouseDown End If Get PopUpMenuSelect(PixelDepthNames, MenuTop, MenuLeft, card field "Compression Depth Code") If it 0 then Put it into card field "Compression Depth Code" Put line it of PixelDepthNames into card field "Compression Depth Name" End If End MouseDown "?Qc 8 Compression Depth Code"  " 0 Key Frame Rate5125122.00 Normal2.00 NormalSpatial QualityTemporal Quality Compressor:rpzaVideo Pixel Depth:5Thousands of coloursCompression SettingsKey frame rate:10-- -- Utility routines -- Function DoesTemporalCompression -- does the currently-selected compressor support frame-differencing. Return char 22 of line 1 of GetCodecFlags(card field "Compressor ID") = 1 End DoesTemporalCompression Function GetFormatFlags -- returns the format flag bits for the currently-selected compressor. Return line 3 of GetCodecFlags(card field "Compressor ID") End GetFormatFlags On TooQuick Answer "Hold the mouse button down a little longer, and " & "the menu will pop up." End TooQuick -- -- Action routines which maintain consistency of settings -- On SetNewValue NamePrefix, NewValue -- sets a new value for the specified compression quality, -- and updates its description. Get NewValue Put it into card field NamePrefix Set numberformat to "0.00" Put it / 256 into DescriptionValue If it = 0 then If first word of NamePrefix is "Temporal" then Get "No Compression" Else Get "Lowest" End If Else If it <= 384 then Get "Low" Else If it <= 768 then Get "Normal" Else If it < 1023 then Get "High" Else If it = 1023 then Get "Highest" Else If it = 1024 then Get "Lossless" Else Get "?" -- shouldnt occur End If Put DescriptionValue && "" && it into card field (NamePrefix && "Description") End SetNewValue On DragSlider -- common MouseDown handler for both compression quality sliders. Put the short name of the target into NamePrefix If first word of NamePrefix is "Temporal" and not DoesTemporalCompression() then Answer "The compressor you have chosen does not support temporal compression." Exit DragSlider End If Put the top of button (NamePrefix && "left") into TopLimit Put the bottom of button (NamePrefix && "left") into BottomLimit Put the right of button (NamePrefix && "left") into LeftLimit Put the left of button (NamePrefix && "right") into RightLimit Put 0 into LastMouseH Repeat while the mouse is down Get the MouseV If it >= TopLimit and it <= BottomLimit then Get the MouseH If it LastMouseH then If it < LeftLimit then Get LeftLimit Else If it > RightLimit then Get RightLimit End If Set loc of button NamePrefix to it, item 2 of the loc of button NamePrefix Get Round((it - LeftLimit) * 1023 / (RightLimit - LeftLimit)) SetNewValue NamePrefix, it End If Put it into LastMouseH End If End Repeat End DragSlider On SetSlider NamePrefix, NewValue -- explicitly sets a given value for the specified compression -- quality setting, and moves the slider to the corresponding -- position. Get NewValue If it < 0 then Get 0 Else If it > 1023 then Get 1023 End If SetNewValue NamePrefix, it Put the right of button (NamePrefix && "left") into LeftLimit Put the left of button (NamePrefix && "right") into RightLimit Get Round(it * (RightLimit - LeftLimit) / 1024) + LeftLimit Set loc of button NamePrefix to it, item 2 of the loc of button NamePrefix End SetSlider BMAP9x x LT,,++,,,++,,,! +,,,,! +,, STBL @FTBL bGenevaChicago@CARD9 v c Vp Spatial QualityOn MouseDown DragSlider End MouseDownV  Temporal QualityOn MouseDown DragSlider End MouseDown6p Spatial Quality Left6p Spatial Quality Right6 Temporal Quality Left8 Temporal Quality Right0 iyx Spatial Quality2 {w Temporal Quality< F Spatial Quality Description> F Temporal Quality Description" ]>p "? ""4b .w Compressor ID"c5 Compressor NameOn MouseDown Put ListCodecs(false) into CompressorList Put empty into CompressorNames Put 0 into ChosenCompressor Repeat with ThisLine = 1 to the number of lines in CompressorList Get line ThisLine of CompressorList If (char 1 to 4 of it) = card field "Compressor ID" then Put ThisLine into ChosenCompressor End If Delete char 1 to 4 of it Put it into line ThisLine of CompressorNames End Repeat Put the top of the target + the top of card window into MenuTop Put the left of the target + the left of card window into MenuLeft If the mouse is up then TooQuick Exit MouseDown End If Get PopUpMenuSelect(CompressorNames, MenuTop, MenuLeft, ChosenCompressor) If it 0 then Put char 1 to 4 of line it of CompressorList into card field "Compressor ID" Put line it of CompressorNames into card field "Compressor Name" Put PixelDepthBits() into PixelDepthBits Put GetFormatFlags() into FormatFlags If char (line (card field "Compression Depth Code") of PixelDepthBits) of FormatFlags = 0 then -- new compressor doesnt support currently-chosen pixel depth. -- Find a depth that it does support (assume there must be one!), -- first searching the colour depths, then the greyscale ones, -- deepest first in each group. Put the number of lines in PixelDepthBits - 4 into ThisLine Repeat If char (line ThisLine of PixelDepthBits) of FormatFlags = 1 then Exit Repeat End If Subtract 1 from ThisLine If ThisLine = 0 then Put the number of lines in PixelDepthBits into ThisLine End If End Repeat Put ThisLine into card field "Compression Depth Code" Put line ThisLine of PixelDepthNames() into card field "Compression Depth Name" End If If not DoesTemporalCompression() then SetSlider "Temporal Quality", 0 End If End If End MouseDown <?cR Compression Depth NameOn MouseDown Put GetFormatFlags() into FormatFlags Put PixelDepthNames() into PixelDepthNames Put PixelDepthBits() into PixelDepthBits Repeat with ThisLine = 1 to the number of lines in PixelDepthBits If char (line ThisLine of PixelDepthBits) of FormatFlags = 0 then Put "(" before line ThisLine of PixelDepthNames End If End Repeat Put the top of the target + the top of card window into MenuTop Put the left of the target + the left of card window into MenuLeft If the mouse is up then TooQuick Exit MouseDown End If Get PopUpMenuSelect(PixelDepthNames, MenuTop, MenuLeft, card field "Compression Depth Code") If it 0 then Put it into card field "Compression Depth Code" Put line it of PixelDepthNames into card field "Compression Depth Name" End If End MouseDown "?Qc 8 Compression Depth Code"  " 0 Key Frame Rate1023.0004.00 Highest0.00 No CompressionSpatial QualityTemporal Quality Compressor:rle Animation Pixel Depth:4 256 coloursCompression SettingsKey frame rate:1-- -- Utility routines -- Function DoesTemporalCompression -- does the currently-selected compressor support frame-differencing. Return char 22 of line 1 of GetCodecFlags(card field "Compressor ID") = 1 End DoesTemporalCompression Function GetFormatFlags -- returns the format flag bits for the currently-selected compressor. Return line 3 of GetCodecFlags(card field "Compressor ID") End GetFormatFlags On TooQuick Answer "Hold the mouse button down a little longer, and " & "the menu will pop up." End TooQuick -- -- Action routines which maintain consistency of settings -- On SetNewValue NamePrefix, NewValue -- sets a new value for the specified compression quality, -- and updates its description. Get NewValue Put it into card field NamePrefix Set numberformat to "0.00" Put it / 256 into DescriptionValue If it = 0 then If first word of NamePrefix is "Temporal" then Get "No Compression" Else Get "Lowest" End If Else If it <= 384 then Get "Low" Else If it <= 768 then Get "Normal" Else If it < 1023 then Get "High" Else If it = 1023 then Get "Highest" Else If it = 1024 then Get "Lossless" Else Get "?" -- shouldnt occur End If Put DescriptionValue && "" && it into card field (NamePrefix && "Description") End SetNewValue On DragSlider -- common MouseDown handler for both compression quality sliders. Put the short name of the target into NamePrefix If first word of NamePrefix is "Temporal" and not DoesTemporalCompression() then Answer "The compressor you have chosen does not support temporal compression." Exit DragSlider End If Put the top of button (NamePrefix && "left") into TopLimit Put the bottom of button (NamePrefix && "left") into BottomLimit Put the right of button (NamePrefix && "left") into LeftLimit Put the left of button (NamePrefix && "right") into RightLimit Put 0 into LastMouseH Repeat while the mouse is down Get the MouseV If it >= TopLimit and it <= BottomLimit then Get the MouseH If it LastMouseH then If it < LeftLimit then Get LeftLimit Else If it > RightLimit then Get RightLimit End If Set loc of button NamePrefix to it, item 2 of the loc of button NamePrefix Get Round((it - LeftLimit) * 1023 / (RightLimit - LeftLimit)) SetNewValue NamePrefix, it End If Put it into LastMouseH End If End Repeat End DragSlider On SetSlider NamePrefix, NewValue -- explicitly sets a given value for the specified compression -- quality setting, and moves the slider to the corresponding -- position. Get NewValue If it < 0 then Get 0 Else If it > 1023 then Get 1023 End If SetNewValue NamePrefix, it Put the right of button (NamePrefix && "left") into LeftLimit Put the left of button (NamePrefix && "right") into RightLimit Get Round(it * (RightLimit - LeftLimit) / 1024) + LeftLimit Set loc of button NamePrefix to it, item 2 of the loc of button NamePrefix End SetSlider n P-h FREEFree Object N _ \@z&bC " E" g NpN:  D 0 NV0.H/NJVDI-@N^NtNVH8$n~pb"-H f08 H-@`p"&H08 H.g-G`~ n P!KT/ /.p *-HY/ p*Jf xY/ p*(_ fp"(H f 08 TAILNu r det slut